package basics;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class InvokeStaticMethod {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Object obj = new Reflection101();
        Class cls = obj.getClass();
        Method mtd = cls.getMethod("printName");
        System.out.println(mtd.invoke(null));//invocation of static method can be passed a null obj
    }
}
